# -*- coding: UTF-8 -*-
'''
@Project: yc-stock
@File: index.py
@Notes: 
@Author: zhuyoucheng
@Date: 2021/3/20 0020 14:15
'''

from flask import Flask
app = Flask(__name__)
from flask import request
from App.Controller.StockCode import StockCode
import json

# @app.route('/', methods=["GET","POST"])
# def index():
#    Index().login()
#    if request.method == "POST":
#       data = json.loads(request.data)
#       print(data['nm'])
#    return "success"

#
@app.route('/stock/save', methods=["POST"])
def save_code_data():
   if request.method == "POST":
      StockCode().save_stock_code()
      return "success"

@app.route('/batch-save-data', methods = ['POST'])
def batch_save_data():
   Index().batch_save_data()
   return 'success'

if __name__ == '__main__':
   app.run()